package com.mohan.lucene;

import java.util.List;

import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;

import com.mohan.pojo.Article;
import com.mohan.service.ArticleService;

public class LuceneInit {
	public static Directory articleRamDir = new RAMDirectory();
	
	public static void BuildDbIndex(ArticleService mService,Directory directory){
		DbIndex dbIndex = new DbIndex();
		dbIndex.buildForSql(mService, directory);
	}
	
	public static List<Article> searchDbIndex(Directory directory, String req, int size){
		DbIndex dbIndex = new DbIndex();
		return dbIndex.search(directory, req, size);		
	}
}
